import { request } from "@/utils/service"

/** 增 */
export function createGoodsApi(data: any) {
  return request({
    url: "goods/add",
    method: "post",
    data
  })
}

/** 删 */
export function deleteGoodsApi(data: any) {
  return request({
    url: `goods/delete`,
    method: "post",
    data
  })
}

/** 改 */
export function updateGoodsApi(data: any) {
  return request({
    url: "goods/update",
    method: "post",
    data
  })
}

/** 查 */
export function getGoodsApi(params: any) {
  return request({
    url: "/goods/list",
    method: "get",
    params
  })
}

// 详情
export function getGoodsDetailApi(data: any) {
  return request({
    url: `goods/byId`,
    method: "get",
    data
  })
}

// 上传图片
export const uploadGoodsImageApi =
  "https://minio.smartsecurity.top:10040/upload/mindisk/acl/uploadFileController/uploadFile"
